<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.11.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>cppMISC: include/designM/composite.hpp 源文件</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<script type="text/javascript" src="../../clipboard.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../cookie.js"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript" src="../../darkmode_toggle.js"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">cppMISC<span id="projectnumber">&#160;v1.1</span>
   </div>
   <div id="projectbrief">cppMisc 文档系统</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.11.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(1); });
/* @license-end */
</script>
<script type="text/javascript" src="../../menudata.js"></script>
<script type="text/javascript" src="../../menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('../../',true,false,'search.php','搜索',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="../../dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="../../dir_7815f4a69fa470e020068bb120d080ef.html">designM</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">composite.hpp</div></div>
</div><!--header-->
<div class="contents">
<a href="../../d5/dfc/composite_8hpp.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &lt;type_traits&gt;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &lt;stack&gt;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span> </div>
<div class="foldopen" id="foldopen00017" data-start="{" data-end="}">
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="../../d6/d7a/namespacecomposite__private____.html">   17</a></span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d6/d7a/namespacecomposite__private____.html">composite_private__</a></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>{</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="../../d4/d5e/structcomposite__private_____1_1st_composite_itfc_base____.html">   19</a></span>    <span class="keyword">struct </span><a class="code hl_struct" href="../../d4/d5e/structcomposite__private_____1_1st_composite_itfc_base____.html">stCompositeItfcBase__</a>{};</div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span>}</div>
</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span> </div>
<div class="foldopen" id="foldopen00022" data-start="" data-end="">
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="../../d5/dfc/composite_8hpp.html#a6bdab9e107d8bdd2a763a06708541f74">   22</a></span><span class="preprocessor">#define DECLARE_COMPOSITE_ITFC( name )      \</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="preprocessor">struct name : public composite_private__::stCompositeItfcBase__ { \</span></div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">    virtual ~name(){}</span></div>
</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span>    </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"><a class="line" href="../../d5/dfc/composite_8hpp.html#a8cd2233fbc0824e09a27c5e4dfb71d2f">   26</a></span><span class="preprocessor">#define COMPOSITE_METHOD( name , ... )     virtual bool name( __VA_ARGS__ ) = 0;</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="../../d5/dfc/composite_8hpp.html#abeb6ec700703a2b0552be0a559735df0">   28</a></span><span class="preprocessor">#define END_COMPOSITE_ITFC()      };</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span> </div>
<div class="foldopen" id="foldopen00030" data-start="" data-end="">
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="../../d5/dfc/composite_8hpp.html#a07ee55ba7664d8f0eb20b67e4f839fea">   30</a></span><span class="preprocessor">#define DECLARE_COMPOSITE_ITFC_DEFAULT( itfcName , ... )        \</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="preprocessor">    DECLARE_COMPOSITE_ITFC( itfcName )                          \</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">    COMPOSITE_METHOD( operation , __VA_ARGS__ )                 \</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="preprocessor">    END_COMPOSITE_ITFC()</span></div>
</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span>    </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../df/d8d/namespacewheels.html">wheels</a></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>{</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="keyword">namespace </span>dm{</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>    <span class="keyword">template</span>&lt; <span class="keyword">typename</span> DATA_TYPE &gt;</div>
<div class="foldopen" id="foldopen00040" data-start="{" data-end="};">
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html">   40</a></span>    <span class="keyword">class </span><a class="code hl_class" href="../../da/d8b/classwheels_1_1dm_1_1composite.html">composite</a></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span>    {</div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a35544e3b87c5b39269287c62829267a1">   43</a></span>        <span class="keyword">using </span><a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a35544e3b87c5b39269287c62829267a1">type_t</a> = <span class="keyword">typename</span> std::remove_pointer&lt;typename std::decay&lt; DATA_TYPE &gt;::type &gt;::type;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span>        </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span>        <span class="keyword">static_assert</span>( std::is_base_of&lt;composite_private__::stCompositeItfcBase__ , type_t&gt;::value , <span class="stringliteral">&quot;&quot;</span> );</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>        </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aa587b1d970586f1d040c77181b3f2124">   47</a></span>        <span class="keyword">using </span><a class="code hl_class" href="../../da/d8b/classwheels_1_1dm_1_1composite.html">composite_t</a> = <a class="code hl_class" href="../../da/d8b/classwheels_1_1dm_1_1composite.html">composite&lt; type_t &gt;</a>;</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#afd2482103a5a98c9e517ba5558d18b0c">   48</a></span>        <span class="keyword">using </span><a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#afd2482103a5a98c9e517ba5558d18b0c">children_t</a> = std::vector&lt; std::shared_ptr&lt; composite&lt; type_t &gt; &gt; &gt;;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">   49</a></span>        <span class="keyword">using </span><a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">iterator</a> = <span class="keyword">typename</span> children_t::iterator;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a8543c019796f26a49fa5c0145022ba81">   51</a></span>        <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a8543c019796f26a49fa5c0145022ba81">composite</a>( ): <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>( nullptr ){}</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a4ba5db04ec0777ebaae1ad986055c5f7">   52</a></span>        <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a4ba5db04ec0777ebaae1ad986055c5f7">composite</a>( std::shared_ptr&lt; type_t &gt; p ): <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>( p ){}</div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span>        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> dataType &gt;</div>
<div class="foldopen" id="foldopen00055" data-start="{" data-end="}">
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a0ec00be907d64dddefbccd302717dddf">   55</a></span>        <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a0ec00be907d64dddefbccd302717dddf">composite</a>( dataType&amp;&amp; data ):<a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>( nullptr ){</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno">   56</span>            <span class="keyword">static_assert</span>( std::is_same&lt;type_t , dataType &gt;::value , <span class="stringliteral">&quot;&quot;</span> );</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>            <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a> = std::make_shared&lt;type_t&gt;( std::move(data) );</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>        }</div>
</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a98ef37c471dd8dab10309508460c83b2">   59</a></span>        <span class="keyword">virtual</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a98ef37c471dd8dab10309508460c83b2">~composite</a>(){}</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a2354a38d1281fb6fbc323534d90f8d5c">   63</a></span>        <span class="keywordtype">bool</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a2354a38d1281fb6fbc323534d90f8d5c">isLeaf</a>(){ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.size() &gt; 0; }</div>
<div class="foldopen" id="foldopen00064" data-start="{" data-end="}">
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aacc3278b82089516e0fff4aea416eabf">   64</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aacc3278b82089516e0fff4aea416eabf">add</a>( <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a35544e3b87c5b39269287c62829267a1">type_t</a>&amp; data ){</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno">   65</span>            <span class="keyword">auto</span> child = std::make_shared&lt;composite_t&gt;( data );</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno">   66</span>            <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.push_back( child );</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span>        }</div>
</div>
<div class="foldopen" id="foldopen00071" data-start="{" data-end="}">
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ab92f4230da211645fc4cb13df79844ad">   71</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ab92f4230da211645fc4cb13df79844ad">add</a>( std::shared_ptr&lt; composite_t&gt; child ){</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>            <span class="keywordflow">if</span>( !child ) <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span>            <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.push_back( child );</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span>        }</div>
</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span> </div>
<div class="foldopen" id="foldopen00076" data-start="{" data-end="}">
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a0e6a196c14a7da2115c9985b00e43fc2">   76</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a0e6a196c14a7da2115c9985b00e43fc2">remove</a>( <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">iterator</a> b , <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">iterator</a> e ){</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>            <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.erase( b , e );</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span>        }</div>
</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span> </div>
<div class="foldopen" id="foldopen00080" data-start="{" data-end="}">
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a49e0b27bdaa260de39dc2fc769dc0ca5">   80</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a49e0b27bdaa260de39dc2fc769dc0ca5">remove</a>( <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">iterator</a> it ){</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>            <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.erase( it );</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span>        }</div>
</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno">   83</span> </div>
<div class="foldopen" id="foldopen00084" data-start="{" data-end="}">
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a41a89cf16b1db50f4c1e8693957ff6e9">   84</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a41a89cf16b1db50f4c1e8693957ff6e9">remove</a>( std::shared_ptr&lt; composite_t&gt; child ){</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno">   85</span>            <span class="keywordflow">if</span>( !child ){</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>                <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno">   87</span>            }</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>            <span class="keyword">auto</span> it = std::find( <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.begin() , <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.end() , child );</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>            <span class="keywordflow">if</span>( it != <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.end() ){</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>                <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.erase( it );</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>            }</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span>        }</div>
</div>
<div class="foldopen" id="foldopen00097" data-start="{" data-end="}">
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ab3c15ad260554dbd3a21ebbd8e0f5b7e">   97</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ab3c15ad260554dbd3a21ebbd8e0f5b7e">clear</a>(){</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>            <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.clear();</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>            <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>.reset();</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>        }</div>
</div>
<div class="foldopen" id="foldopen00105" data-start="{" data-end="}">
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a6271055dd7e1cb171e2018aab1304179">  105</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a6271055dd7e1cb171e2018aab1304179">preOrderTraversal</a>(std::function&lt;<span class="keywordtype">bool</span> (<a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a35544e3b87c5b39269287c62829267a1">type_t</a>*)&gt; func) {</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span>            <span class="keywordflow">if</span>( <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a2354a38d1281fb6fbc323534d90f8d5c">isLeaf</a>() ){</div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>                func( <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>-&gt;get() );</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>                <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>            }</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>            std::stack&lt;iterator&gt; stack;</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span>            stack.push(<a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.begin());</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span>            <span class="keywordflow">while</span> (!stack.empty()) {</div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno">  113</span>                <span class="keyword">auto</span> it = stack.top();</div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno">  114</span>                stack.pop();</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span> </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>                <span class="keywordflow">if</span>( func( !it-&gt;get() )) <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>                <span class="comment">// 处理孩子节点</span></div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>                <span class="keywordflow">if</span> ( it-&gt;get() &amp;&amp; !it-&gt;get()-&gt;isLeaf()) {</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span>                    stack.push(it-&gt;begin());               <span class="comment">// 子节点入栈</span></div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span>                }</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>                <span class="keyword">auto</span> it1 = std::next(it-&gt;begin());</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>                <span class="keywordflow">if</span>( it1 != <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.end() ){</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>                    stack.push( it1 );    <span class="comment">// 兄弟节点入栈</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>                }</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span>            }</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>        }</div>
</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span> </div>
<div class="foldopen" id="foldopen00132" data-start="{" data-end="}">
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a5f5824597553f21d6f4c55bb80a74a43">  132</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a5f5824597553f21d6f4c55bb80a74a43">preOrderTraversal</a>(std::function&lt;<span class="keywordtype">bool</span> (<a class="code hl_class" href="../../da/d8b/classwheels_1_1dm_1_1composite.html">composite_t</a> *)&gt; func) {</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>            <span class="keywordflow">if</span>( <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a2354a38d1281fb6fbc323534d90f8d5c">isLeaf</a>() ){</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>                func( <span class="keyword">this</span> );</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>                <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>            }</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>            std::stack&lt;iterator&gt; stack;</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>            stack.push(<a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.begin());</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>            <span class="keywordflow">while</span> (!stack.empty()) {</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>                <span class="keyword">auto</span> it = stack.top();</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>                stack.pop();</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span> </div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>                <span class="keywordflow">if</span>( func( <span class="keyword">this</span> )) <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span>                <span class="comment">// 处理孩子节点</span></div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno">  145</span>                <span class="keywordflow">if</span> ( it-&gt;get() &amp;&amp; !it-&gt;get()-&gt;isLeaf()) {</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno">  146</span>                    stack.push((*it)-&gt;begin());               <span class="comment">// 子节点入栈</span></div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span>                }</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>                <span class="keyword">auto</span> it1 = std::next(it);</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>                <span class="keywordflow">if</span>( it1 != <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.end() ){</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>                    stack.push( it1 );    <span class="comment">// 兄弟节点入栈</span></div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>                }</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>            }</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>        }</div>
</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>        </div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> ...PARAMS &gt;</div>
<div class="foldopen" id="foldopen00160" data-start="{" data-end="}">
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a4777c5e6ab8e777034b3049d60519568">  160</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a4777c5e6ab8e777034b3049d60519568">preOrderTraversalDefault</a>( PARAMS&amp;&amp; ...params ) {</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>            <span class="keywordflow">if</span>( <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a2354a38d1281fb6fbc323534d90f8d5c">isLeaf</a>() ){</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>                <span class="keywordflow">if</span>( <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>){</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span>                    <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>-&gt;operation(std::forward&lt;PARAMS&gt;(params)... );</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span>                }</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span>                <span class="keywordflow">return</span>;</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno">  166</span>            }</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span>            std::stack&lt;iterator&gt; stack;</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span>            stack.push(<a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.begin());</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span>            <span class="keywordflow">while</span> (!stack.empty()) {</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno">  170</span>                <span class="keyword">auto</span> it = stack.top();</div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno">  171</span>                stack.pop();</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno">  172</span> </div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno">  173</span>                <span class="keywordflow">if</span>( it-&gt;get() &amp;&amp; !it-&gt;get()-&gt;operation( std::forward&lt;PARAMS&gt;(params)... ) ) <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno">  174</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno">  175</span>                <span class="comment">// 处理孩子节点</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span>                <span class="keywordflow">if</span> (it-&gt;get() &amp;&amp; !it-&gt;get()-&gt;isLeaf()) {</div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span>                    stack.push((*it)-&gt;begin());               <span class="comment">// 子节点入栈</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span>                }</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno">  179</span>                <span class="keyword">auto</span> it1 = std::next(it );</div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span>                <span class="keywordflow">if</span>( it1 != <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.end() ){</div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span>                    stack.push( it1 );    <span class="comment">// 兄弟节点入栈</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span>                }</div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span>            }</div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span>        }</div>
</div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span>        <span class="keyword">template</span>&lt; <span class="keyword">typename</span> ...PARAMS &gt;</div>
<div class="foldopen" id="foldopen00190" data-start="{" data-end="}">
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a6b6b7bc2aa69824af6ee71a78d43fc97">  190</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a6b6b7bc2aa69824af6ee71a78d43fc97">for_eachDefault</a>( PARAMS&amp;&amp;... params ){</div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span>            <span class="keywordflow">for</span>( <span class="keyword">auto</span> item : <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a> ){</div>
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno">  192</span>                <span class="keywordflow">if</span>( !item-&gt;get() ) <span class="keywordflow">continue</span>;</div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>                <span class="keywordtype">bool</span> rst = item-&gt;get()-&gt;operation( std::forward&lt;PARAMS&gt;(params)... );</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span>                <span class="keywordflow">if</span>( !rst ) <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span>            }</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span>        }</div>
</div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span>        </div>
<div class="foldopen" id="foldopen00202" data-start="{" data-end="}">
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ad6933767c028e20b7c9226c6af8249cd">  202</a></span>        <span class="keywordtype">void</span> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ad6933767c028e20b7c9226c6af8249cd">for_each</a>( std::function&lt; <span class="keywordtype">void</span> ( <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a35544e3b87c5b39269287c62829267a1">type_t</a> * ) &gt; fun ){</div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span>            <span class="keywordflow">for</span>( <span class="keyword">auto</span> item : <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a> ){</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno">  204</span>                <span class="keywordtype">bool</span> rst = fun( item.get() );</div>
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno">  205</span>                <span class="keywordflow">if</span>( !rst ) <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span>            }</div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>        }</div>
</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span>        </div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a985b2c27710affbb1d15d4abca4cec00">  209</a></span>        <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a35544e3b87c5b39269287c62829267a1">type_t</a> * <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a985b2c27710affbb1d15d4abca4cec00">get</a>(){ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>.get(); }</div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span> </div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#af03de7a732846907c21f5bac29c28c59">  211</a></span>        <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">iterator</a> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#af03de7a732846907c21f5bac29c28c59">begin</a>(){ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.begin(); }</div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ac926fc472823057a26e0cb6bff8c4c36">  212</a></span>        <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">iterator</a> <a class="code hl_function" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ac926fc472823057a26e0cb6bff8c4c36">end</a>(){ <span class="keywordflow">return</span> <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>.end(); }</div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span>    <span class="keyword">protected</span>:</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">  214</a></span>        <a class="code hl_typedef" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#afd2482103a5a98c9e517ba5558d18b0c">children_t</a>   <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">m_children__</a>;                <span class="comment">// 所有的子节点</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"><a class="line" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">  215</a></span>        std::shared_ptr&lt; type_t &gt;     <a class="code hl_variable" href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">p_obj__</a>;    <span class="comment">// 当前节点的数据内容</span></div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span>    };</div>
</div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span> </div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span>}}</div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html">wheels::dm::composite</a></div><div class="ttdef"><b>定义</b> <a href="#l00040">composite.hpp:41</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a0e6a196c14a7da2115c9985b00e43fc2"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a0e6a196c14a7da2115c9985b00e43fc2">wheels::dm::composite::remove</a></div><div class="ttdeci">void remove(iterator b, iterator e)</div><div class="ttdef"><b>定义</b> <a href="#l00076">composite.hpp:76</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a0ec00be907d64dddefbccd302717dddf"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a0ec00be907d64dddefbccd302717dddf">wheels::dm::composite::composite</a></div><div class="ttdeci">composite(dataType &amp;&amp;data)</div><div class="ttdef"><b>定义</b> <a href="#l00055">composite.hpp:55</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a2354a38d1281fb6fbc323534d90f8d5c"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a2354a38d1281fb6fbc323534d90f8d5c">wheels::dm::composite::isLeaf</a></div><div class="ttdeci">bool isLeaf()</div><div class="ttdoc">判断是否是叶子节点</div><div class="ttdef"><b>定义</b> <a href="#l00063">composite.hpp:63</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a35544e3b87c5b39269287c62829267a1"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a35544e3b87c5b39269287c62829267a1">wheels::dm::composite::type_t</a></div><div class="ttdeci">typename std::remove_pointer&lt; typename std::decay&lt; DATA_TYPE &gt;::type &gt;::type type_t</div><div class="ttdef"><b>定义</b> <a href="#l00043">composite.hpp:43</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a41a89cf16b1db50f4c1e8693957ff6e9"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a41a89cf16b1db50f4c1e8693957ff6e9">wheels::dm::composite::remove</a></div><div class="ttdeci">void remove(std::shared_ptr&lt; composite_t &gt; child)</div><div class="ttdef"><b>定义</b> <a href="#l00084">composite.hpp:84</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a4777c5e6ab8e777034b3049d60519568"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a4777c5e6ab8e777034b3049d60519568">wheels::dm::composite::preOrderTraversalDefault</a></div><div class="ttdeci">void preOrderTraversalDefault(PARAMS &amp;&amp;...params)</div><div class="ttdoc">先序遍历操作</div><div class="ttdef"><b>定义</b> <a href="#l00160">composite.hpp:160</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a49e0b27bdaa260de39dc2fc769dc0ca5"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a49e0b27bdaa260de39dc2fc769dc0ca5">wheels::dm::composite::remove</a></div><div class="ttdeci">void remove(iterator it)</div><div class="ttdef"><b>定义</b> <a href="#l00080">composite.hpp:80</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a4ba5db04ec0777ebaae1ad986055c5f7"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a4ba5db04ec0777ebaae1ad986055c5f7">wheels::dm::composite::composite</a></div><div class="ttdeci">composite(std::shared_ptr&lt; type_t &gt; p)</div><div class="ttdef"><b>定义</b> <a href="#l00052">composite.hpp:52</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a551849e74ae83615076eaf80bf7cf624"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a551849e74ae83615076eaf80bf7cf624">wheels::dm::composite::p_obj__</a></div><div class="ttdeci">std::shared_ptr&lt; type_t &gt; p_obj__</div><div class="ttdef"><b>定义</b> <a href="#l00215">composite.hpp:215</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a5f5824597553f21d6f4c55bb80a74a43"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a5f5824597553f21d6f4c55bb80a74a43">wheels::dm::composite::preOrderTraversal</a></div><div class="ttdeci">void preOrderTraversal(std::function&lt; bool(composite_t *)&gt; func)</div><div class="ttdoc">先序遍历操作</div><div class="ttdef"><b>定义</b> <a href="#l00132">composite.hpp:132</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a6271055dd7e1cb171e2018aab1304179"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a6271055dd7e1cb171e2018aab1304179">wheels::dm::composite::preOrderTraversal</a></div><div class="ttdeci">void preOrderTraversal(std::function&lt; bool(type_t *)&gt; func)</div><div class="ttdoc">先序遍历操作</div><div class="ttdef"><b>定义</b> <a href="#l00105">composite.hpp:105</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a6b6b7bc2aa69824af6ee71a78d43fc97"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a6b6b7bc2aa69824af6ee71a78d43fc97">wheels::dm::composite::for_eachDefault</a></div><div class="ttdeci">void for_eachDefault(PARAMS &amp;&amp;... params)</div><div class="ttdoc">for_eachDefault</div><div class="ttdef"><b>定义</b> <a href="#l00190">composite.hpp:190</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a8543c019796f26a49fa5c0145022ba81"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a8543c019796f26a49fa5c0145022ba81">wheels::dm::composite::composite</a></div><div class="ttdeci">composite()</div><div class="ttdef"><b>定义</b> <a href="#l00051">composite.hpp:51</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a95c4abddafa272604354b724027500fd"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a95c4abddafa272604354b724027500fd">wheels::dm::composite::m_children__</a></div><div class="ttdeci">children_t m_children__</div><div class="ttdef"><b>定义</b> <a href="#l00214">composite.hpp:214</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a985b2c27710affbb1d15d4abca4cec00"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a985b2c27710affbb1d15d4abca4cec00">wheels::dm::composite::get</a></div><div class="ttdeci">type_t * get()</div><div class="ttdef"><b>定义</b> <a href="#l00209">composite.hpp:209</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_a98ef37c471dd8dab10309508460c83b2"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#a98ef37c471dd8dab10309508460c83b2">wheels::dm::composite::~composite</a></div><div class="ttdeci">virtual ~composite()</div><div class="ttdef"><b>定义</b> <a href="#l00059">composite.hpp:59</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_aacc3278b82089516e0fff4aea416eabf"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aacc3278b82089516e0fff4aea416eabf">wheels::dm::composite::add</a></div><div class="ttdeci">void add(type_t &amp;data)</div><div class="ttdef"><b>定义</b> <a href="#l00064">composite.hpp:64</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_ab3c15ad260554dbd3a21ebbd8e0f5b7e"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ab3c15ad260554dbd3a21ebbd8e0f5b7e">wheels::dm::composite::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdoc">清除内容</div><div class="ttdef"><b>定义</b> <a href="#l00097">composite.hpp:97</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_ab92f4230da211645fc4cb13df79844ad"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ab92f4230da211645fc4cb13df79844ad">wheels::dm::composite::add</a></div><div class="ttdeci">void add(std::shared_ptr&lt; composite_t &gt; child)</div><div class="ttdoc">添加子节点</div><div class="ttdef"><b>定义</b> <a href="#l00071">composite.hpp:71</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_ac926fc472823057a26e0cb6bff8c4c36"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ac926fc472823057a26e0cb6bff8c4c36">wheels::dm::composite::end</a></div><div class="ttdeci">iterator end()</div><div class="ttdef"><b>定义</b> <a href="#l00212">composite.hpp:212</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_ad6933767c028e20b7c9226c6af8249cd"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#ad6933767c028e20b7c9226c6af8249cd">wheels::dm::composite::for_each</a></div><div class="ttdeci">void for_each(std::function&lt; void(type_t *) &gt; fun)</div><div class="ttdoc">本层遍历</div><div class="ttdef"><b>定义</b> <a href="#l00202">composite.hpp:202</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_aec09fcb021fe205cb430a2af7ebc1c5b"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#aec09fcb021fe205cb430a2af7ebc1c5b">wheels::dm::composite::iterator</a></div><div class="ttdeci">typename children_t::iterator iterator</div><div class="ttdef"><b>定义</b> <a href="#l00049">composite.hpp:49</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_af03de7a732846907c21f5bac29c28c59"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#af03de7a732846907c21f5bac29c28c59">wheels::dm::composite::begin</a></div><div class="ttdeci">iterator begin()</div><div class="ttdef"><b>定义</b> <a href="#l00211">composite.hpp:211</a></div></div>
<div class="ttc" id="aclasswheels_1_1dm_1_1composite_html_afd2482103a5a98c9e517ba5558d18b0c"><div class="ttname"><a href="../../da/d8b/classwheels_1_1dm_1_1composite.html#afd2482103a5a98c9e517ba5558d18b0c">wheels::dm::composite::children_t</a></div><div class="ttdeci">std::vector&lt; std::shared_ptr&lt; composite&lt; type_t &gt; &gt; &gt; children_t</div><div class="ttdef"><b>定义</b> <a href="#l00048">composite.hpp:48</a></div></div>
<div class="ttc" id="anamespacecomposite__private_____html"><div class="ttname"><a href="../../d6/d7a/namespacecomposite__private____.html">composite_private__</a></div><div class="ttdoc">组合模式</div><div class="ttdef"><b>定义</b> <a href="#l00017">composite.hpp:18</a></div></div>
<div class="ttc" id="anamespacewheels_html"><div class="ttname"><a href="../../df/d8d/namespacewheels.html">wheels</a></div><div class="ttdoc">堆栈信息读取和保存记录</div><div class="ttdef"><b>定义</b> <a href="../../d3/df7/ary__str_8hpp_source.html#l00006">ary_str.hpp:7</a></div></div>
<div class="ttc" id="astructcomposite__private_____1_1st_composite_itfc_base_____html"><div class="ttname"><a href="../../d4/d5e/structcomposite__private_____1_1st_composite_itfc_base____.html">composite_private__::stCompositeItfcBase__</a></div><div class="ttdef"><b>定义</b> <a href="#l00019">composite.hpp:19</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.11.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
